package com.wx.nchu_mall.web;


import com.wx.nchu_mall.model.OperateOrder;
import com.wx.nchu_mall.service.OperateOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class OperateOrderController {
    @Autowired
    protected OperateOrderService operateOrderService;


    @PostMapping("/api/operateOrder/insert")
    public String insert(@RequestBody OperateOrder operateOrder){
        operateOrderService.insert(operateOrder);
        return "success";
    }
    @PostMapping("/api/operateOrder/{orderId}")   //寻找该订单的操作记录
    public List<OperateOrder> findOperateList(@PathVariable Integer orderId){
         return operateOrderService.findOperateOrderList(orderId);
    }
}
